<style lang="scss" scoped>
@import '../../styles/common/loading.less';
.container{
    border: none !important;
    margin-top: 4px;
}
.el-col-offset-1 {
    margin-left: 0%;
}
.button_a {
    background-color: rgba(255, 138, 0, 1);
    border-color: rgba(255, 138, 0, 1);
}
.col_a {
    margin-left: 2%;
}
.el-card {
    height: 200px;
}

.el-button--primary {
    background-color: rgba(255, 138, 0, 1);
    border-color: rgba(255, 138, 0, 1);
}
</style>
<template>
    <div  class="common-background-color"
          v-loading="loading"
          element-loading-text="loading......"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.8)">
        <div style="width:98%;margin: 6px 12px;">
            <el-collapse v-model="activeNames">
                <el-collapse-item title="注销信息"  name="1">
                    <!-- 注销信息 -->
                    <el-form ref="prpLCancel" :model="prpLCancel"  class="info-submit-form">
                        <el-row type="flex">
                            <el-col :span="8">
                                <el-form-item label="大病赔案号">
                                    <el-input v-model="prpLCancel.caseNo"  disabled></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="保单号">
                                    <el-input v-model="policyNo"  disabled></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="社/医保号">
                                    <el-input v-model="socialSecurityNo"  disabled></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex">
                            <el-col :span="8">
                                <el-form-item label="被保险人">
                                    <el-input v-model="insuredName"  disabled></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8" >
                                <el-form-item label="证件号">
                                    <el-input v-model="documentNo"  disabled></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8"  >
                                <el-form-item label="注销原因">
                                    <el-input v-model="prpLCancel.cancelReasonName"  disabled></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex">
                            <el-col :span="24" >
                                <el-form-item label="注销详情" :required="true">
                                    <el-input show-word-limit disabled v-model="prpLCancel.cancelDescribe" type="textarea" ></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                </el-collapse-item>
            </el-collapse>
            <el-collapse v-model="activeNames">
                <el-collapse-item title="注销历史轨迹" name="2">
                  <div style="background-color:#FFF;">
                    <el-table
                      :data="prpLClaimOpinionRecordDTOList"
                      class="table"
                      ref="multipleTable"
                      header-cell-class-name="table-header"
                    >
                      <el-table-column prop="handlerCode" label="审核人工号" align="center"></el-table-column>
                      <el-table-column prop="handlerName" label="审核人姓名" align="center"></el-table-column>
                      <el-table-column prop="auditOpinion" :formatter="formatTaskState" label="审核状态" align="center"></el-table-column>
                      <el-table-column prop="remark" label="备注" align="center"></el-table-column>
                      <!-- <el-table-column prop="evaluate" label="评价" align="center"></el-table-column> -->
                      <el-table-column prop="handlTime" label="审核时间" align="center"></el-table-column>
                    </el-table>
                  </div>
                </el-collapse-item>
            </el-collapse>
            <div style="margin-top: 25px;text-align: center;height: 70px">
                <el-button type="primary" size="medium" style="width: 9%" @click="closePage()">关  闭</el-button>
            </div>
        </div>
    </div>
</template>
<script>
import { queryCaseCancelDetail} from '@/api/baseDate'
export default {
    name: 'caseCancelDetailSeeCache',
    data() {
        return {
            activeNames: ['1','2'],
            loading: false,
            Successdialog:false,
            item:0,
            time:0,
            prpLCancel: {
                cancelReason:'', // 注销原因代码
                cancelReasonName:'', // 注销原因
            },
            prpLClaimOpinionRecordDTOList: [],
            id:'',
            taskState:'',
            policyNo:'', // 保单号
            insuredName:'', // 被保险人
            socialSecurityNo:'', // 社保号
            documentTypeName:'', // 证件类型
            documentNo:'', // 证件号

            comCode: '', // 归属机构编码
        }
    },
    activated(){
        if(this.$route.params.taskId!=undefined){
            this.queryCaseCancelTaskDetail();
        }
    },
    created() {
        this.queryCaseCancelTaskDetail();
    },
    methods: {
        // 案件详情
        queryCaseCancelTaskDetail(){
            let taskId  = this.$route.params.taskId;
            this.id = taskId;
            this.taskState = this.$route.params.taskState;
            const param = {
                id: this.id,
            }
            this.policyNo = this.$route.params.policyNo;
            this.insuredName = this.$route.params.insuredName;
            this.socialSecurityNo = this.$route.params.socialSecurityNo;
            this.documentTypeName = this.$route.params.documentTypeName;
            this.documentNo = this.$route.params.documentNo;
            // this.prpLCancel.cancelReasonName = this.$route.params.cancelReasonName;
            queryCaseCancelDetail(param) .then((res)=> {
                if(res){
                  if(res.data.resultCode){
                      if(res.data.resultCode != '0000'){ 
                          // 返回失败
                          this.$message.error(res.data.resultMsg);
                      }else{
                            this.prpLCancel = res.data;
                            this.prpLClaimOpinionRecordDTOList = res.data.prpLClaimOpinionRecordDTOList;
                            if (this.prpLCancel.cancelReason ==='a' ) {
                                this.prpLCancel.cancelReasonName = '客户报错案和重复报案'
                            } else if (this.prpLCancel.cancelReason === 'b') {
                                this.prpLCancel.cancelReasonName = '不属于投保险别或险种出险'
                            } else if (this.prpLCancel.cancelReason === 'c') {
                                this.prpLCancel.cancelReasonName = '客户主动放弃索赔'
                            } else if (this.prpLCancel.cancelReason === 'd') {
                                this.prpLCancel.cancelReasonName = '其它'
                            }
                      }
                  }else{
                      this.$message.error('系统异常'); 
                  }
                }else{
                  this.$message.error('系统异常'); 
                }
            })
        },
        // 关闭当前页
        closePage(){
            this.closePageTo(this.$store,this.$route,this.$router,'caseCancelAudit');
        }
    }

}
</script>